public class RefereeStateWhistle : State<Referee>
{
	private static RefereeStateWhistle instance;

	private RefereeStateWhistle()
	{
	}

	public static RefereeStateWhistle getInstance()
	{
		if (instance == null)
		{
			instance = new RefereeStateWhistle();
		}
		return instance;
	}

	public override void enter(Referee owner)
	{
		base.enter(owner);
		owner.LookAt(MathHelper.setY(Instance<Ball>.instance.getPosition(), 0f));
		owner.playAnimation(AnimationName.referee_whistle, 1f, 0.3f);
		Instance<AudioController>.instance.play(AudioType.Sound_whistle);
		if (Instance<Court>.instance.foulType == FoulType.BLOCK)
		{
			owner.do_freethrow();
		}
	}

	public override void fixedUpdate(Referee owner)
	{
		base.fixedUpdate(owner);
		if (owner.GetComponent<UnityEngine.Animation>()[AnimationName.referee_whistle].normalizedTime > 0.9f || !owner.IsPlayingAnimation())
		{
			switch (Instance<Court>.instance.foulType)
			{
			case FoulType.BLOCK:
				break;
			case FoulType.BACKCOURT:
				owner.do_playing();
				break;
			case FoulType.CHARGING:
				owner.do_playing();
				break;
			case FoulType.STEAL:
				owner.do_playing();
				break;
			case FoulType.OUTSIDE:
				owner.do_playing();
				break;
			}
		}
	}
}
